/**
 * @author : Arthur
 * @since : 2018-9-25 9:17
 */
$(function () {
    var funcId = $('#forward_funcId').val();
    var funcName = $('#forward_funcName').val();
    SideBar.init({
        toggle: true,
        backTop: false,
        spacing: 43,
        showHideStyle: 'whole',
        blocks: [{
            color: '#3497db',
            bgColor: '#fff',
            placeholder: '收藏',
            content: 'fa fa-star-o',
            onClick: function () {
                top.openCollectModal(funcId,funcName);
            }
        }, {
            color: '#3497db',
            bgColor: '#fff',
            placeholder: '评价',
            content: 'fa fa-pencil-square-o',
            onClick: function () {
                var $modal = $('#forwardModal');

                $modal.find('#forwardModalLabel').text('我的评价');
                $modal.find('.modal-body').html('<iframe src="/portal/user/evaluate/init.do?gnid=' + funcId + '"></iframe>');
                $modal.find('iframe').css({
                    height: '600px'
                });

                $modal.modal('show');
            }
        }, {
            color: '#3497db',
            bgColor: '#fff',
            placeholder: '详情',
            content: 'fa fa-file-text',
            onClick: function () {
                var $modal = $('#forwardModal');

                $modal.find('#forwardModalLabel').text('功能详情');
                $modal.find('.modal-body').html('<iframe src="/portal/user/explain/init.do?gnid=' + funcId + '"></iframe>');
                $modal.find('iframe').css({
                    height: '500px'
                });

                $modal.modal('show');
            }
        }]
    });
});

function createFileInput(num) {
    if (3 === num) {
        $('#demandExplainFile_div table tbody').append(
            '<tr>' +
            ' <td>' +
            '  <a href="" target="_blank"></a>' +
            ' </td>' +
            '</tr>'
        );
    } else if (4 === num) {
        $('#technologyExplainFile_div table tbody').append(
            '<tr>' +
            ' <td>' +
            '  <a href="" target="_blank"></a>' +
            ' </td>' +
            '</tr>'
        );
    }
}